<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>进程调度</title>
    <link href="http://apps.bdimg.com/libs/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet">
    <script src="http://apps.bdimg.com/libs/jquery/2.0.0/jquery.min.js"></script>
    <script src="http://apps.bdimg.com/libs/bootstrap/3.3.0/js/bootstrap.min.js"></script>
    <script src="js/Process.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        body {
            overflow: hidden;
        }

        .main {
            height: 700px;
            margin: 0 auto;
            background-color: #ccc;
            /* border: 1px solid #000; */
        }

        .create {
            float: left;
            width: 20%;
            height: 100%;
        }

        .create h2 {
            margin: 15px 10px;
        }

        .create label {
            display: block;
            margin-left: 10%;
        }

        .create input {
            width: 80%;
            height: 30px;
            margin: 5px 0;
            margin-left: 10%;
            border: 1px solid #ccc;
            border-radius: 5px;
            outline: 0;
            font-size: 16px;
        }

        .create button {
            display: block;
            /* width: 100px; */
            height: 30px;
            margin: 15px auto 30px;
            padding: 0 20px;
            color: #fff;
            /* background-color: #afeeee; */
            border: 0;
            cursor: pointer;
        }

        .Float{
            font-weight: bold;
            float: left;
        }
        .new{
            margin-top: 50px;
        }

        .install {
            margin-top: 40px;
            border-bottom: 1px solid #000;
        }
        .install h2{
            text-align:center;
        }
        .create h2{
            text-align:center;
        }

        .timeCount{
            font-weight:bold;
            font-size: 30px;
        }

        .view {
            position: relative;
            float: left;
            width: 80%;
            height: 100%;
            background-color: #fff;
        }

        .control {
            float: right;
            width: 300px;
            height: auto;
            padding: 20px;
            background-color: #a7aca5;
            /* text-align: right; */
            border: 1px solid #ccc;
            border-radius: 20px;
            margin: 10px;
            font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
            font-size: 20px;
        }

        .control button {
            width: 100px;
            height: 40px;
        }

        .process {
            float: left;
            display: flex;
            flex-direction: row;
            justify-content: space-around;
            width: 700px;
            margin: 30px 0 0 10px;
        }

        .work {
            width: 100px;
            height: 100px;
            color: #fff;
            background-color: #74e34d;
            line-height: 100px;
            text-align: center;
            border-radius: 20px;
        }

        .ing {
            float: left;
            width: 100%;
            height: auto;
            margin: 20px 0;
            background-color: #dff0d8;
            padding: 30px;
        }

        .ready {
            float: left;
            width: 100%;
            height: auto;
            background-color: #fcf8e3;
            padding: 30px;
        }

        .warn{
            text-align: center;
            font-weight: bold;
            display: none;
        }

        .tip{
            text-align: center;
            font-weight: bold;
        }

    </style>
</head>

<body>
    <div class="main">
        <!-- 左侧部分 -->
        <div class="create">
            <div class="install">
                <h2>初始进程</h2>
                <label for="">打印机数量</label><input type="text">
                <button class="btn btn-primary">设置打印机</button>
            </div>
            <div class="new">
                <h2>新建进程</h2>
                <!-- <form action=""> -->
                <!-- <label for="">进程id</label><input type="text" id="new_id"> -->
                <label for="">进程名称</label><input type="text" id="new_name">
                <label for="">提交时间</label><input type="text" id="new_arriveTime">
                <label for="">服务时间</label><input type="text" id="new_needTime">
                <label for="">优先级</label><input type="text" id="new_prio">
                <!-- <label for="">打印机请求数量</label><input type="text" id="new_num"> -->
                <button id="createProcess" onclick="createProcess()" class="btn btn-primary">新建</button>
                <!-- </form> -->
            </div>
        </div>
        <!-- 右侧部分 -->
        <div class="view">
            <!-- 控制台 -->
            <div class="control">
                <!-- 下拉列表框 -->
                <div>   
                    运行时间:
                    <span id="timecount" class="timeCount">0</span>
                    s
                </div>
               <div style="margin-bottom: 20px;">
                <div>
                    进程调度算法:
                    <select name="algo" id="algo" class="form-control">
                        <option value="FIFO">先来先服务算法</option>
                        <option value="SJF">短作业优先算法</option>
                    </select>
                    <p></p>
                    <select name="" id="" class="form-control">
                        <option value="非抢占式优先调度">非抢占式优先调度</option>
                        <option value="抢占式优先调度">抢占式优先调度</option>
                    </select>
                </div>
               </div>
                <div>
                    <button id="clockBtn" class="btn btn-primary" onclick="StopStartClock()" style="float: left;">运行</button>
                    <button id="clockBtn" class="btn btn-primary" onclick="reset()" style="float: right;">重置</button>
                </div>

            </div>
            <div class="alert alert-danger warn" id="warn" role="alert">运行结束请刷新页面！</div>
            <div class="alert alert-info tip" id="tip" role="alert">左侧创建进程!</div>

            <div class="process" id="que_process">
                <!-- <div class="work">进程1</div>
                <div class="work">进程2</div>
                <div class="work">进程3</div>
                <div class="work">进程4</div>
                <div class="work">进程5</div>
                <div class="work">进程6</div> -->
            </div>


            <div class="ing">
                <span class="Float">当前运行进程</span>
                <div id="cur_process" class="process">
                    <!-- <div class="work">进程1</div>
                    <div class="work">进程2</div>
                    <div class="work">进程3</div>
                    <div class="work">进程4</div>
                    <div class="work">进程5</div>
                    <div class="work">进程6</div> -->
                </div>

            </div>
            <div class="ready">
                <span class="Float">当前就绪进程</span>
                <div id="rea_process"  class="process">
                    <!-- <div class="work">进程1</div>
                    <div class="work">进程2</div>
                    <div class="work">进程3</div>
                    <div class="work">进程4</div>
                    <div class="work">进程5</div>
                    <div class="work">进程6</div> -->
                </div>
            </div>

        </div>
    </div>
    <script>
        var pc_height = document.documentElement.clientHeight;
        var pc_width = document.documentElement.clientWidth;
        var main = document.querySelector('.main');
        main.style.height = pc_height + 'px';
        main.style.width = pc_width + 'px';
        window.onresize = function () {
            var pc_height = document.documentElement.clientHeight;
            var pc_width = document.documentElement.clientWidth;
            var main = document.querySelector('.main');
            main.style.height = pc_height + 'px';
            main.style.width = pc_width + 'px';
        }
    </script>
</body>

</html>